package com.t.bricks.bussiness.service.customergoldroll.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.t.bricks.bussiness.db.dao.customergoldroll.CustomerGoldRollDao;
import com.t.bricks.bussiness.db.entity.customergoldroll.CustomerGoldRoll;
import com.t.bricks.bussiness.service.customergoldroll.CustomerGoldRollService;
import com.t.bricks.model.MsgEmity;
import com.t.bricks.utils.spring.ModuleUtil;

/**
 * 顾客所持代金卷'CustomerGoldRoll表'基本业务操作类接口实现
 * @author HuangXinBian
 * @DateTime 2022年06月22日 15:25:27
 */
@Service
public class CustomerGoldRollServiceImpl implements CustomerGoldRollService<CustomerGoldRoll> {

	@Autowired
	private CustomerGoldRollDao<CustomerGoldRoll> customerGoldRollDao;
	
	/**
	 * 领取代金卷
	 * @param sGoldRollNo 代金卷号码
	 * @return
	 */
	@Override
	public MsgEmity employ(String sGoldRollNo) {
		MsgEmity me = customerGoldRollDao.employ(sGoldRollNo, ModuleUtil.currentLoginUserId());
		if (!me.isSuccess()) {
			return me;
		}
		
		int i = me.getData();
		if (i <= 0) {
			return MsgEmity.err(9001, "领取失败!");
		}
		
		return MsgEmity.success(9999, "领取成功");
	}
	
	/**
	 * 使用代金卷
	 * @param sGoldRollNo 代金卷号码
	 * @return
	 */
	@Override
	public MsgEmity use(String uId) {
		
		
		
		
		
		return null;
	}
	
}
